/*
* Copyright (c) 2011 Mladen Milankovic <mmlado at gmail.com>.
*
* This file is part of Demine application
*
* Demine is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Demine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with Demine.  If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    id: about
    tools: ToolBarLayout {
        visible: true
        ToolIcon {
            iconId: "toolbar-back";
            onClicked: { about.close(); }
        }
    }

    signal close()

    Flickable {
        anchors.fill: parent
        contentWidth: parent.width
        contentHeight: content.height + 20
        Column {
            id: content
            width: parent.width
            spacing: 20

            Label {
                text: 'Demine'
                anchors.horizontalCenter: parent.horizontalCenter
                platformStyle: LabelStyle {
                    fontPixelSize: 40
                }
            }

            Button {
                text: 'Home'

                anchors.horizontalCenter: parent.horizontalCenter
                onClicked: {
                    Qt.openUrlExternally('http://projects.developer.nokia.com/demine');
                }
            }

            Column {
                width: parent.width
                spacing: 20
                Row {
                    spacing: 20
                    width: parent.width - 20
                    Label {
                        id: lblDeveloper
                        text: 'Developer:'
                    }
                    Label {
                        text: 'Mladen Milanković'
                    }
                }

                Row {
                    spacing: 20
                    width: parent.width - 20
                    Label {
                        text: 'Contact:'
                        width: lblDeveloper.width
                    }
                    Button {
                        text: 'developer@mmlado.com'
                        height: lblDeveloper.height

                        onClicked: {
                            Qt.openUrlExternally('mailto:developer@mmlado.com?subject=Demine feedback');
                        }
                    }
                }

                Row {
                    spacing: 20
                    width: parent.width - 20
                    Label {
                        text: 'Donate:'
                        width: lblDeveloper.width
                    }

                    Image {
                        width: 140
                        height: 30
                        source: '../core/images/flattr-badge-large.png'

                        MouseArea {
                            anchors.fill: parent
                            onClicked: {
                                Qt.openUrlExternally('http://flattr.com/thing/453120/Demine');
                            }
                        }
                    }

                    Image {
                        width: 106
                        height: 30
                        source: '../core/images/paypal.gif'

                        MouseArea {
                            anchors.fill: parent
                            onClicked: {
                                Qt.openUrlExternally('https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=U5RX65H9SM4JE&lc=HU&item_name=Demine&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted')
                            }
                        }
                    }
                }
            }

            Label {
                text: 'Between you and victory stands a few mines that are hidden under some of the fields.
Your mission: reveal all the fields that don\'t have any of the mines.
Help will come in the form of numbers under the fields adjacent to a mine. The higher the number the more mines are around that field.
Help also comes in form of flags, that you can place on a field where you suspect there is a mine. This way you won\'t accidentally dig on a field there might be a mine.'
                //anchors.fill: parent
                width: parent.width - 20
                anchors.horizontalCenter: parent.horizontalCenter
                horizontalAlignment: Text.AlignJustify
            }

            Label {
                text: 'Instructions'
                anchors.horizontalCenter: parent.horizontalCenter
                platformStyle: LabelStyle {
                    fontPixelSize: 30
                }
            }

            Label {
                text: 'tap - turn/flip field
tap and hold - put flag on field
drag/flick - move table around'
                width: parent.width - 20
                anchors.horizontalCenter: parent.horizontalCenter
                horizontalAlignment: Text.AlignJustify
            }

            Label {
                text: 'Conditions'
                anchors.horizontalCenter: parent.horizontalCenter
                platformStyle: LabelStyle {
                    fontPixelSize: 30
                }
            }

            Label {
                text: 'Win = reveal all the fields that don\'t have mines.
Loose = reveal a field that has a mine.'
                width: parent.width - 20
                anchors.horizontalCenter: parent.horizontalCenter
                horizontalAlignment: Text.AlignJustify
            }
        }
    }
}
